package com.ljx.consumer.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-06-27  22:08
 */
//@Configuration
public class FanoutConfig {

    @Bean
    public FanoutExchange fanoutExchange1(){
        return new FanoutExchange("test.fanout2");
    }

    @Bean
    public Queue fanoutQueue1(){
        return new Queue("fanout.queue3");
    }

//    @Bean
//    public Binding binding(){
//        return BindingBuilder.bind(fanoutQueue1()).to(fanoutExchange1());
//    }

    @Bean
    public Binding binding(FanoutExchange fanoutExchange1, Queue fanoutQueue1){
        return BindingBuilder.bind(fanoutQueue1).to(fanoutExchange1);
    }
}
